/*
 * @Author: your name
 * @Date: 2021-05-17 11:18:31
 * @LastEditTime: 2022-07-12 17:12:29
 * @LastEditors: wei_jt@ecidi.com
 * @Description: In User Settings Edit
 * @FilePath: \central-system\src\utils\pwdEncrypt.js
 */
import { pwdEncrypType } from '@/config'
import { SM4, SM2 } from './sm4'
import md5 from 'js-md5'
export function pwdEncrypt (value) {
  if (value) {
    switch (pwdEncrypType) {
      case 'MD5': {
        return md5(value)
      }
      case 'SM2': {
        return SM2.encrypt(value)
      }
      default: {
        return SM4.encrypt(value)
      }
    }
  }
}